widget: Re-shuffle preconditions in snapshot_child()
authorTimm Bäder <mail@baedert.org>
Sat, 6 Jun 2020 10:22:46 +0000 (12:22 +0200)
committerTimm Bäder <mail@baedert.org>
Fri, 19 Jun 2020 03:26:24 +0000 (05:26 +0200)
The GtkNative type check is more expensive than the mapped one, so avoid
the former for unmapped widgets

gtk/gtkwidget.c

index a95c1cc13e97b6bc77f0d7a35c6e13cec0bf62ac..0986b2538285c99f7adcf93f313e6487b98c251d 100644 (file)
@@ -12045,10 +12045,10 @@ gtk_widget_snapshot_child (GtkWidget   *widget,
   g_return_if_fail (_gtk_widget_get_parent (child) == widget);
   g_return_if_fail (snapshot != NULL);
 
-  if (GTK_IS_NATIVE (child))
+  if (!_gtk_widget_get_mapped (child))
     return;
 
-  if (!_gtk_widget_get_mapped (child))
+  if (GTK_IS_NATIVE (child))
     return;
 
   gtk_widget_do_snapshot (child, snapshot);